<html>
<head>
	<script>
	<? if($this->id == ''){?>
		common.setMainTitle('Add New User');
	<? }else {?>
		common.setMainTitle('Edit User');
	<? } ?>
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body style="background-color: transparent">
<form id="id-form" name="frm" id="frm" method="post" action="/admin/users/save">
    <input type="hidden" name="USERID" value="<?=$this->id ?>" />
    <table>
       
        <tr>
            <td nowrap="nowrap">First Name</td>
            <td><input class="" id="FIRSTNAME" name ="FIRSTNAME" value="<?=(isset($this->data->FIRSTNAME)?$this->data->FIRSTNAME:'')?>" type ="text" size ="50" maxlength="75">
            </td>
        </tr>
        <tr>
            <td nowrap="nowrap">Last Name <font color="red">*</font></td>
            <td><input class="" id="LASTNAME" name ="LASTNAME" value="<?=(isset($this->data->LASTNAME)?$this->data->LASTNAME:'')?>" type ="text" size ="50" maxlength="75">
            </td>
        </tr>
		<tr>
            <td nowrap="nowrap">Email <font color="red">*</font></td>
            <td>
                <input class="" id="EMAIL" name ="EMAIL" value="<?=(isset($this->data->EMAIL)?$this->data->EMAIL:'')?>" type ="text" size ="50" maxlength="75">
            </td>
        </tr>
        <tr>
            <td nowrap="nowrap">Role <font color="red">*</font></td>
            <td>
                <select name ="ROLEID" id="ROLEID" style="width: 205px" value="0" >
                    <option value="0">-- Chọn vai trò --</option>
                    <?
                    $selected = "";
                    foreach($this->listRole as $role){
                        if($role['ROLEID'] == $this->data->ROLEID ){
                            $selected = "selected=''";
                        }else{
                            $selected = "";
                        }
                    ?>
                    <option <?=$selected?> value="<?=$role['ROLEID']?>"><?=$role['NAME']?></option>
                    <? } ?>
                </select>
            </td>
        </tr>
        
        <tr>
            <td nowrap="nowrap">Is Active</td>
            <td>
                <input type="checkbox" name="STATUS" id="STATUS" <?=(isset($this->data->STATUS) && $this->data->STATUS == "1" ? "checked=''":''); ?>/>
            </td>
        </tr>
        <tr>
			<td>
				<input type="submit" value="Save" />
				<input type="button" value="Cancel" onclick="javascript:history.go(-1)" />
			</td>
        </tr>        
    </table>
</form>
<script>
</script>
</body>
</html>